<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //join方法以指定参数作为分隔符，将所有数组成员连接为一个字符串返回，如果不提供参数默认用逗号分隔
        var index = [1,2,3,4,5,6,7,8,9]
        console.log(index.join('|'));
        //如果数组成员是null或undefined，会被转换成空字符串
        var index1 = ['1','2',null, undefined]
        console.log(index1.join());
        //数组方法join配合字符串方法split可以实现数组与字符串的互换
        var names = ['我','是','高','伟','杰']
        var gwj = names.join("");
        console.log(gwj);
        
    </script>
</body>
</html>